package com.baidu.common.util;

import org.dom4j.Element;

import com.baidu.automata.core.type.DataField;
import com.baidu.config.TypeConfig;

public class FieldUtil {
	public static DataField initFiled(Element e) throws Exception {
		String tagName = e.getName();
		String typeClassName = TypeConfig.getInstance().getProperty(tagName);
		DataField f = (DataField) Class.forName(typeClassName).newInstance();
		f.deserialize(e);
		return f;
	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
